#pragma once
//============================================================================
// Copyright (C) 2009-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
class RcSysRxEvent
{
public:
	//=== constructor ===//
	RcSysRxEvent();
	//=== constructor ===//
	RcSysRxEvent( RcSktBase * poSkt, VxPktHdr * poPkt, ESktCallbackReason eCallbackReason, RCODE rc = 0 );

	//=== destructor ===//
	virtual ~RcSysRxEvent();

	//=== methods ===//


	//=== vars ===//
	RcSktBase *				m_poSkt;
	RcSysPktHdr *			m_poPkt;
	ESktCallbackReason		m_eCallbackReason;
	RCODE					m_rcError;
};

class RcSysSktRxEventQue 
{
public:
	//=== vars ===//
	VxMutex						m_oRxEventMutex;
	std::vector<RcSysRxEvent*>	m_aoRxEvents;

	//=== constructor ===//
	RcSysSktRxEventQue();
	//=== destructor ===//
	virtual ~RcSysSktRxEventQue();

	//=== methods ===//
	//! add event to que
	void			AddSktRxEvent( RcSysRxEvent * poEvent );
	//! remove event from que.. returns null if no events avalil
	RcSysRxEvent *	RemoveSktRxEvent(  void );

};



